package co.baiku.boot.common.validate;

public class ValidationResult {
    private boolean success;
    private String fieldName;
    private ValidationErrorType errorType;
    private String msg;
    private int code;
    private String key;

    public ValidationResult() {
    }

    public ValidationResult(boolean success, String msg) {
        this.success = success;
        this.msg = msg;
    }

    public ValidationResult(boolean success, String msg, int code, String key) {
        this(success, msg);
        this.key = key;
        this.code = code;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public ValidationErrorType getErrorType() {
        return errorType;
    }

    public void setErrorType(ValidationErrorType errorType) {
        this.errorType = errorType;
    }

    public static ValidationResult getSUCCESS() {
        return SUCCESS;
    }

    public static void setSUCCESS(ValidationResult SUCCESS) {
        ValidationResult.SUCCESS = SUCCESS;
    }

    public static ValidationResult SUCCESS = new ValidationResult(true, "OK");

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}
